package com.atlin.project.service.task;

import com.atlin.project.model.domain.SysUser;
import com.atlin.project.model.domain.task.UserTasks;
import com.atlin.project.model.dto.userTasks.UserTasksAddRequest;
import com.atlin.project.model.dto.userTasks.UserTasksEditRequest;
import com.atlin.project.model.dto.userTasks.UserTasksQueryRequest;
import com.atlin.project.model.vo.UserTasksVO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;

/**
 * @author atlin
 * @description userTasks
 * @createDate date
 */
public interface UserTasksService extends IService<UserTasks> {

    void validAndFill(UserTasks userTasks, boolean add);

    /**
     * 获取封装
     *
     * @param userTasks
     * @param request
     * @return
     */
    UserTasksVO getUserTasksVO(UserTasks userTasks, HttpServletRequest request);


    /**
     * 获取查询条件
     *
     * @param questionQueryRequest
     * @return
     */
    QueryWrapper<UserTasks> getQueryWrapper(UserTasksQueryRequest questionQueryRequest);

    /**
     * 分页获取封装
     *
     * @param questionPage
     * @param request
     * @return
     */
    Page<UserTasksVO> getUserTasksVOPage(Page<UserTasks> questionPage, HttpServletRequest request);


    Page<UserTasksVO> getMyUserTasksVOPage(UserTasksQueryRequest userTasksQueryRequest);


    Long createUserTask(UserTasksAddRequest userTasksAddRequest, SysUser loginUser);

    boolean editUserTask(UserTasksEditRequest userTasksEditRequest, SysUser loginUser);
}
